using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Media3D;

namespace Sensor.UI.Models;

/// <summary>
/// 点云信息
/// </summary>
public class PointCloudInfo
{
    public PointCloudCameraInfo CameraInfo { get; set; } = null!;
    /// <summary>
    /// 分布区域集合
    /// </summary>
    public List<PointCloudRegionInfo> RegionInfos { get; set; } = [];

    /// <summary>
    /// 区域点集合
    /// </summary>
    public List<PointCloudItemInfo> ItemInfos { get; set; } = [];
}

/// <summary>
/// 相机
/// </summary>
public class PointCloudCameraInfo
{
    /// <summary>
    /// Position
    /// </summary>
    public Point3D Position { get; set; }

    /// <summary>
    /// LookDirection
    /// </summary>
    public Vector3D LookDirection { get; set; }

    /// <summary>
    /// UpDirection
    /// </summary>
    public Vector3D UpDirection { get; set; }
}

/// <summary>
/// 点云区域信息
/// </summary>
public class PointCloudRegionInfo
{
    /// <summary>
    /// 索引
    /// </summary>
    public int Index { get; set; }
    /// <summary>
    /// 区域中心点
    /// </summary>
    public Point3D CenterPoint { get; set; }

    /// <summary>
    /// 法向量
    /// </summary>
    public PointCloudRegionItemInfo CenterItemInfo { get; set; } = null!;

    /// <summary>
    /// 区域内的点云点集合
    /// </summary>
    public List<PointCloudRegionItemInfo> ItemInfos { get; set; } = [];
    
    /// <summary>
    /// 点分配到区域的距离阈值
    /// </summary>
    public double DistanceThreshold { get; set; }
}

/// <summary>
/// 点云点信息 
/// </summary>
public class PointCloudRegionItemInfo
{
    /// <summary>
    /// 点坐标
    /// </summary>
    public Point3D Point { get; set; }

    /// <summary>
    /// 法向量
    /// </summary>
    public Vector3D Vector { get; set; }

    /// <summary>
    /// 距离区域中心点的距离
    /// </summary>
    public double DistanceToCenter { get; set; }
}

/// <summary>
/// 点云点信息 
/// </summary>
public class PointCloudItemInfo
{
    /// <summary>
    /// 点坐标
    /// </summary>
    public Point3D Point { get; set; }

    /// <summary>
    /// 法向量
    /// </summary>
    public Vector3D Vector { get; set; }
}